<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: chordPlayer</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: chordPlayer</h1>

    




<section>

<header>
    
        <h2>chordPlayer</h2>
        
            <div class="class-description">A musical chord that can be played in a browser. Plays for however long it has been defined to.</div>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    
    <h2>Constructor</h2>
    

    <h4 class="name" id="chordPlayer"><span class="type-signature"></span>new chordPlayer<span class="signature">(chordName, audioContext<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>chordName</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">name of the chord, i.e "Cmin7b5"</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audioContext</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">WebAudio audioContext</td>
        </tr>

    
    </tbody>
</table>






    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>octave</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">musical octave of the note forming the chord [1-8]</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>name</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">Full name of the chord</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>duration</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">length of time the sound has to be played, in seconds</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>volume</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">volume [0-1]</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>notes</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">Array of notePlayer instances, these are the notes composing the chord</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>isPlaying</code></td>
            

            <td class="type">
            
                
<span class="param-type">Bool</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">true if the sound is being played</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>verbose</code></td>
            

            <td class="type">
            
                
<span class="param-type">Boolean</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">verbose mode (true/false)</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>audioContext</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                
                </td>
            

            

            <td class="description last">WebAudio audioContext. Created if not provided</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>destinationNode</code></td>
            

            <td class="type">
            
                
<span class="param-type">Object</span>


            
            </td>

            
                <td class="attributes">
                

                
                </td>
            

            

            <td class="description last">WebAudio destinationNode</td>
        </tr>

    
    </tbody>
</table>




<dl class="details">

    

    

    

    

    

    

    

    

    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>David B - laopunk</li>
        </ul>
    </dd>
    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="chordPlayer.js.html">chordPlayer.js</a>, <a href="chordPlayer.js.html#line6">line 6</a>
    </li></ul></dd>
    

    

    

    
</dl>















    <h5>Example</h5>
    
    <pre class="prettyprint"><code>cp = new chordPlayer("Cmaj7")</code></pre>



    
    </div>

    

    

    

     

    

    

    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="chordPlayer.html">chordPlayer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#buildChordPlayer">buildChordPlayer</a></li><li><a href="global.html#getChordInfo">getChordInfo</a></li><li><a href="global.html#play">play</a></li><li><a href="global.html#setAudioContext">setAudioContext</a></li><li><a href="global.html#setDestinationNode">setDestinationNode</a></li><li><a href="global.html#setDuration">setDuration</a></li><li><a href="global.html#setOctave">setOctave</a></li><li><a href="global.html#setVerbose">setVerbose</a></li><li><a href="global.html#setVolume">setVolume</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Dec 08 2016 20:20:04 GMT+0000 (GMT)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>